|
|
|
|
|
|
|
properties. In addition, you can also modify code and change variable or property values during the execution of the application as well as being able to specify the next statement to be executed. To test and debug an application, you need to understand the three unique modes that you will be working in. Two of these modes you should already be somewhat familiar with. |
|
|
|
|
|
|
|
|
When you are in the process of creating or coding your application, your are in Visual Basic's Design mode. When you are running the application, you are in Run mode. During the debugging process, you will be working in the third mode, called Break mode, which suspends the execution of the application so you can examine and alter any data or code. To know which mode you are in requires you to look only as far as the Visual Basic title bar. The title bar will always display the current mode as shown in Figure 18.2. |
|
|
|
|
|
|
|
|
Figure 18.2.
The Visual Basic title bar will always display the current mode enclosed
in square brackets. |
|
|
|
|
|
|
|
|
Table 18.1 describes each of these three modes and the actions you can take. |
|
|
|
|
| TABLE 18.1. THE ACTIONS OF THE THREE VISUAL BASIC OPERATING MODES. | | Mode | Description | | Design | Most of the work of creating an application is done at designtime. You can design forms, draw controls, write code, and use the Properties window to set or view any of the property settings. However, you cannot execute any code or use the available debugging tools, except for setting the breakpoints and creating watch expressions. | | Run | When you execute the application, you interact with the application the same as a user. You can view code, but you cannot change it. | | Break | Execution of the application is suspended. You can view and edit code, examine or modify data, restart the application, stop execution, or continue execution from the same point. |
|
|
|
|
|
|
On the standard toolbar, Visual Basic provides three buttons that enable you to quickly change from one mode to another (see Figure 18.3). |
|
|
|
|
|